/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package research.prototype.transaction;

import org.biz.invoicesystem.entity.transactions.SalesInvoice;

/**
 *
 * @author yy
 */
public class Invoice extends javax.swing.JPanel {

    /**
     * Creates new form Invoice
     */
    public Invoice() {
        initComponents();
    }
    
    public void init() {
        
      
        // create line item
        // validate line item
        // add or update line item
        // remove line item
        // calulate totel 
        // set total
        // get whole bus object
        
        
    }
    


    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane2 = new javax.swing.JScrollPane();
        tblInvoiceLine1 = new org.components.controls.ModelEditableTable();
        cButton1 = new org.components.controls.CButton();
        tinv = new org.components.controls.CTextField();
        ttotal = new org.components.controls.CLabel();
        tdiscount = new org.components.controls.CLabel();
        cLabel1 = new org.components.controls.CLabel();
        cLabel2 = new org.components.controls.CLabel();
        cLabel3 = new org.components.controls.CLabel();
        tpnlLineDetail = new org.components.containers.CPanel();
        tqty = new org.components.controls.CTextField();
        tprice = new org.components.controls.CTextField();
        tline = new org.components.controls.CLabel();
        itemPopup1 = new research.prototype.transaction.ItemPopup();
        tline1 = new org.components.controls.CLabel();
        gridControllerPanel1 = new com.components.custom.GridControllerPanel();
        cLabel4 = new org.components.controls.CLabel();
        cLabel5 = new org.components.controls.CLabel();
        cLabel6 = new org.components.controls.CLabel();

        setLayout(null);

        tblInvoiceLine1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        jScrollPane2.setViewportView(tblInvoiceLine1);

        add(jScrollPane2);
        jScrollPane2.setBounds(20, 170, 770, 210);

        cButton1.setText("Find");
        cButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cButton1ActionPerformed(evt);
            }
        });
        add(cButton1);
        cButton1.setBounds(120, 10, 25, 19);
        add(tinv);
        tinv.setBounds(20, 10, 93, 25);

        ttotal.setText("Total");
        add(ttotal);
        ttotal.setBounds(580, 460, 70, 30);

        tdiscount.setText("Discount");
        add(tdiscount);
        tdiscount.setBounds(580, 500, 80, 30);

        cLabel1.setText("Paid");
        add(cLabel1);
        cLabel1.setBounds(230, 430, 70, 40);

        cLabel2.setText("Tax");
        add(cLabel2);
        cLabel2.setBounds(250, 490, 70, 40);

        cLabel3.setText("Sub Total");
        add(cLabel3);
        cLabel3.setBounds(580, 420, 80, 32);

        tpnlLineDetail.setLayout(null);
        tpnlLineDetail.add(tqty);
        tqty.setBounds(200, 10, 160, 30);
        tpnlLineDetail.add(tprice);
        tprice.setBounds(370, 10, 130, 30);

        tline.setText("");
        tpnlLineDetail.add(tline);
        tline.setBounds(630, 10, 90, 30);

        itemPopup1.setText("");
        tpnlLineDetail.add(itemPopup1);
        itemPopup1.setBounds(30, 10, 140, 30);

        tline1.setText("Line Amount");
        tpnlLineDetail.add(tline1);
        tline1.setBounds(510, 10, 104, 30);

        add(tpnlLineDetail);
        tpnlLineDetail.setBounds(20, 120, 770, 50);
        add(gridControllerPanel1);
        gridControllerPanel1.setBounds(800, 160, 90, 220);

        cLabel4.setBackground(new java.awt.Color(204, 204, 255));
        cLabel4.setText("");
        cLabel4.setOpaque(true);
        add(cLabel4);
        cLabel4.setBounds(690, 500, 200, 30);

        cLabel5.setBackground(new java.awt.Color(204, 204, 255));
        cLabel5.setText("");
        cLabel5.setOpaque(true);
        add(cLabel5);
        cLabel5.setBounds(690, 420, 200, 30);

        cLabel6.setBackground(new java.awt.Color(204, 204, 255));
        cLabel6.setText("");
        cLabel6.setOpaque(true);
        add(cLabel6);
        cLabel6.setBounds(690, 460, 200, 30);
    }// </editor-fold>//GEN-END:initComponents

    private void cButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cButton1ActionPerformed
    
    }//GEN-LAST:event_cButton1ActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private org.components.controls.CButton cButton1;
    private org.components.controls.CLabel cLabel1;
    private org.components.controls.CLabel cLabel2;
    private org.components.controls.CLabel cLabel3;
    private org.components.controls.CLabel cLabel4;
    private org.components.controls.CLabel cLabel5;
    private org.components.controls.CLabel cLabel6;
    private com.components.custom.GridControllerPanel gridControllerPanel1;
    private research.prototype.transaction.ItemPopup itemPopup1;
    private javax.swing.JScrollPane jScrollPane2;
    private org.components.controls.ModelEditableTable tblInvoiceLine1;
    private org.components.controls.CLabel tdiscount;
    private org.components.controls.CTextField tinv;
    private org.components.controls.CLabel tline;
    private org.components.controls.CLabel tline1;
    private org.components.containers.CPanel tpnlLineDetail;
    private org.components.controls.CTextField tprice;
    private org.components.controls.CTextField tqty;
    private org.components.controls.CLabel ttotal;
    // End of variables declaration//GEN-END:variables
}
